package cn.wbu.zyh.controller.user;

import cn.wbu.zyh.result.Result;
import cn.wbu.zyh.service.TagService;
import cn.wbu.zyh.service.UserService;
import cn.wbu.zyh.vo.ArticleVO;
import cn.wbu.zyh.vo.UserVO;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/{username}")
    @ApiOperation("查询用户")
    public Result<UserVO> getById(@PathVariable String username){
        log.info("查询用户信息：{}",username);
        UserVO userVO = userService.getByUsername(username);
        return Result.success(userVO);
    }

}
